<template>
  <div class="xh-menu-item">
    <span class="item blue" v-for="(item,index) in menu" :class="{'active': $route.fullPath.includes(`${item.path}`)}" :key="index" @click="selectMenu(item, index)">{{item.name}}</span>
  </div>
</template>
<script>
export default {
  name: "headBar",
  computed: {
  },
  data () {
    return {
      currentIndex: 0,
      menu: [{
        name: '科技创新',
        path: '/innovation/technological'
      }, {
        name: '工程创优',
        path: '/innovation/project'
      }, {
        name: '星级评定',
        path: '/innovation/star'
      }]
    }
  },
  components: {
  },
  mounted () {
  },
  created () {
  },
  methods: {
    selectMenu (item, index) {
      this.currentIndex = index
      this.$router.replace({ path: item.path })
    }
  }
}

</script>

<style lang="scss">
</style>
